package com.red.star.wechat.data.entity;

import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.Version;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @author AMGuo
 * @Description 粉丝蓄客卡
 * @date 2018/03/02 10:41
 */
@Data
@Table(name = "t_fans_card")
public class FansCard extends BaseEntity {

    /**
     * c粉丝id
     */
    @Column(name = "fans_id")
    private Integer fansId;

    /**
     * b粉丝id
     */
    @Column(name = "b_fans_id")
    private Integer bFansId;

    /**
     * 蓄客卡id
     */
    @Column(name = "card_id")
    private Integer cardId;

    /**
     * 0:未购买1：购买  2退款
     */
    @Column(name = "pay_status")
    private Integer payStatus;

    /**
     * 用户留资名
     */
    @Column(name = "name")
    private String name;

    /**
     * 电话
     */
    @Column(name = "mobile")
    private String mobile;

    /**
     * 地址
     */
    @Column(name = "address")
    private String address;

    /**
     * 省
     */
    @Column(name = "province")
    private String province;

    /**
     * 市
     */
    @Column(name = "city")
    private String city;

    /**
     * 区
     */
    @Column(name = "district")
    private String district;


    /**
     * 装修状态
     */
    @Column(name = "decoration")
    private String decoration;

    /**
     * 购买金额
     */
    @Column(name = "money")
    private Double money;

    /**
     * 导购员所属联盟组
     */
    @Column(name = "group_id")
    private Integer groupId;

    /**
     * 导购员employeeId
     */
    @Column(name = "employee_id")
    private Integer employeeId;

    /**
     * 购买者vip_open_id
     */
    @Column(name = "vip_open_id")
    private String vipOpenId;

    /**
     * unionId
     */
    @Column(name = "union_id")
    private String unionId;

    @Version
    private Integer version;

    /**
     * prepay_id
     */
    private String prepayId;

    /**
     * 购买时间
     */
    private Date payTime;

    /**
     * 购买者open_id
     */
    private String openId;

    /**
     * 订单编号
     */
    private String orderId;

    /**
     * 收益
     */
    @Transient
    private BigDecimal income;

    @Transient
    private String groupName;

    @Transient
    private String storedCardName;

    /**
     * 核销状态：-1无  1已核销  0未核销
     */
    private Integer verificationStatus = -1;

    /**
     * 核销时间
     */
    private Date verificationTime;

    public FansCard() {
    }

    public FansCard(Integer fansId, Integer bFansId, Integer cardId, Integer groupId, Integer employeeId, String vipOpenId) {
        this.fansId = fansId;
        this.bFansId = bFansId;
        this.cardId = cardId;
        this.groupId = groupId;
        this.employeeId = employeeId;
        this.vipOpenId = vipOpenId;
    }

    public FansCard(Integer fansId, Integer cardId, Integer groupId, Integer employeeId, String unionId, Integer payStatus) {
        this.fansId = fansId;
        this.cardId = cardId;
        this.groupId = groupId;
        this.employeeId = employeeId;
        this.unionId = unionId;
        this.payStatus = payStatus;
    }

    public FansCard(Integer cardId, Integer payStatus, Integer groupId, Integer employeeId, String unionId,
                    Double money) {
        this.cardId = cardId;
        this.payStatus = payStatus;
        this.groupId = groupId;
        this.employeeId = employeeId;
        this.unionId = unionId;
        this.money = money;
    }

    @Override
    public String toString() {
        return "FansCard{" +
                "fansId=" + fansId +
                ", bFansId=" + bFansId +
                ", cardId=" + cardId +
                ", payStatus=" + payStatus +
                ", name='" + name + '\'' +
                ", mobile='" + mobile + '\'' +
                ", address='" + address + '\'' +
                ", province='" + province + '\'' +
                ", city='" + city + '\'' +
                ", district='" + district + '\'' +
                ", decoration='" + decoration + '\'' +
                ", money=" + money +
                '}';
    }
}
